<section class="container">
<div class="content-wrap">
<div class="content">
  <header class="article-header">
	<h1 class="article-title"><a href="#" title="{$_G.article.title}" >{$_G.article.title}</a></h1>
	<div class="article-meta"> 
	<span class="item article-meta-time">
	  <time class="time" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="发表时间：2016-10-14"><i class="glyphicon glyphicon-time"></i> {$_G.article.pub_time|date="Y-m-d", ###}</time>
	  </span> 
	  <span class="item article-meta-source" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="来源：{$_G.article.source}"><i class="glyphicon glyphicon-globe"></i> 
	  <a href="{$_G.article.source_url}">{$_G.article.source}</a>
	  </span> 
	  <span class="item article-meta-category" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="{$_G.article.cat_name}"><i class="glyphicon glyphicon-list"></i> <a href="/cat/{$_G.article.catid}" title="{$_G.article.cat_name}" >{$_G.article.cat_name}</a></span> 
	  <span class="item article-meta-comment" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="评论量"><i class="glyphicon glyphicon-comment"></i> {$_G.article.reply_count}</span> 
	  </div>
  </header>
  <article class="article-content">
  {$_G.article.content}
  </article>
  <div class="article-tags">{$_G.article.taglist}</div>
  <div class="relates">
	<div class="title">
	  <h3>相关推荐</h3>
	</div>
	<ul>
		{volist name="_G.promote" id="promote"}
		<li><a href="/detail/{$promote.aid}" title="{$promote.title}" >{$promote.title}</a></li>
		{/volist}
	</ul>
  </div>
  <div class="title" id="comment">
	<h3>评论</h3>
  </div>
  <div id="respond">
		<form id="comment-form" name="comment-form" action="" method="POST">
			<div class="comment">
				<input type="hidden" name="aid" value="{$_G.article.aid}" />
				<input name="comment_user" id="comment-user" class="form-control" size="22" placeholder="您的昵称（必填）" maxlength="15" autocomplete="off" tabindex="1" type="text">
				<div class="comment-box">
					<textarea placeholder="您的评论或留言（必填）" name="comment_cnt" id="comment-textarea" cols="100%" rows="3" tabindex="3"></textarea>
					<div class="comment-ctrl">
						<button type="button" name="comment-submit" id="comment-submit" tabindex="4">评论</button>
					</div>
				</div>
			</div>
		</form>
	</div>
  <div id="postcomments">
	<ol id="comment_list" class="commentlist">     
	{volist name="_G.reply" id="reply" key="index"}
	<li class="comment-content"><span class="comment-f">#{$index}</span><div class="comment-main"><p><a class="address" rel="nofollow" target="_blank">{$reply.replier}</a><span class="time">({$reply.reply_time|date="Y-m-d H:i", ###})</span><br>{$reply.reply_cnt}</p></div></li>
	{/volist}
	 <div class="widget widget_hot" style="text-align: center"><a href="/comment/{$_G.article.aid}" style="font-size: 1.5em;display: block;" >查看所有评论</a></div>
  </div>
</div>
</div>
<aside class="sidebar">
<div class="widget widget_hot">
	  <h3>热门评论文章</h3>
	  <ul>
		{volist name="_G.hotest" id="hotest"}
		<li><a title="{$hotest.title}" href="/detail/{$hotest.aid}" ><span class="thumbnail">
		<img class="thumb" data-original="{$hotest.headpic}" src="{$hotest.headpic}" alt="{$hotest.title}"  style="display: block;">
		</span><span class="text">{$hotest.title}</span><span class="muted"><i class="glyphicon glyphicon-time"></i>
		{$hotest.pub_time|date="Y-m-d", ###}
		</span><span class="muted"><i class="glyphicon glyphicon-comment"></i> {$hotest.reply_count}</span></a></li>
		{/volist}

	  </ul>
 </div>
</aside>
</section>
<script type="text/javascript">
window.onload = function(){
	$('#comment-submit').click(function(){
		if($('#comment-user').val() == ''){
			return false;
		};
		if($('#comment-textarea').val() == ''){
			return false;
		};
		var data = $('#comment-form').serialize();
		$.post('/reply', data, function(res){
			if(typeof res != 'object') res = JSON.parse(res);
			console.dir(res)
			if(res.status == '200') {
				alert('评论成功');
				window.reload();
			} else {	
				alert(res.message);
			}
		});
	});
};
</script>